package com.landeb.shop.huo.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.landeb.shop.R;
import com.landeb.shop.huo.bean.BeanScoreLogAct;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * Created by blade on 2017/4/13.
 */

public class ActScoreLogRVAdapter extends BaseQuickAdapter<BeanScoreLogAct.DataBean.ListBean,BaseViewHolder> {

    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");

    public ActScoreLogRVAdapter(int layoutResId, List<BeanScoreLogAct.DataBean.ListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, BeanScoreLogAct.DataBean.ListBean item) {

        String time = simpleDateFormat.format(new Date(Long.parseLong(item.getCtime())*1000L));

        helper.setText(R.id.tv_name_item_score_log_act_rv, item.getDetail())
                .setText(R.id.tv_money_item_score_log_act_rv, item.getAll())
                .setText(R.id.tv_time_item_score_log_act_rv, time);

    }


}
